Description: Moves, activates and redisplays the specified event object
Mapped Command: MOVE EVENT <label>
FUNCTION __MovEventRegion(label,Pos1,Pos2,activate,deactivate)
local handle := __ScanObjects(label) // get a handle if possible
local PrevPos1, PrevPos2, currcolor
if handle > 0 // find out if the button exists
PrevPos1 := _handles_[handle,1] // save the old position
PrevPos2 := _handles_[handle,2] // save the old position
_handles_[handle,1] := Pos1 // status (active)
_handles_[handle,2] := Pos2 // status (active)
_handles_[handle,9] := if(activate == NIL,_handles_[handle,9],ActiveObject)
_handles_[handle,9] := if(deactivate == NIL,_handles_[handle,9],InactiveObject)
do case
case _handles_[handle,06] == EventRegionObject
_handles_[handle,3] := _handles_[handle,3] + (Pos1 - PrevPos1)
_handles_[handle,4] := _handles_[handle,4] + (Pos2 - PrevPos2)
case _handles_[handle,06] == IconButtonObject
msethot(handle, ;
__XdGE(_handles_[handle,2] - (_icnwidt_/2)), ;
__YdGE((_handles_[handle,1] + _icnheig_) - (_icnheig_/2)), ;
__XdGE_(_icnwidt_), ;
__YdGE_(_icnheig_))
if _handles_[handle,7] // if a shadow has been selected, display shadow
currcolor := setcolor() // save the current color
setcolor(_eshadow_) // set color to the shadow color and draw the shadow box
loadicon(_dgepath_ + "gllibr.ico")
__DrawSuperIcon(0,_handles_[handle,1]+IconShadowOffsetD,_handles_[handle,2]+IconShadowOffsetR)
loadicon(_icnfile_)
setcolor(currcolor) // restore the Clipper color
endif // if shadow
__DrawSuperIcon(_handles_[handle,10],_handles_[handle,1],_handles_[handle,2])
case _handles_[handle,06] == TextButtonObject
* ...
endcase
else // otherwise the button doesn't exists
__HandleError(NoSuchLabel,label) // process the error
endif
RETURN(Void)
See Also:MOVE EVENT
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson